package com.smartthinking.qualitystores;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class Cliente implements KvmSerializable {
	public String ultupdt;
	public String almacen;
	public String monto;
	public String tipo;
	public float saldo_actual;
	public float liquede_con;
	public float mv_la;
	public float mv;
	public float pm24;
	public float pm12;
	public float linea_articulos;
	public float linea_prestamos;
	
	public Cliente()
	{
		ultupdt = "";
		almacen = "";
		monto = "";
		tipo = "";
		saldo_actual = 0;
		liquede_con = 0;
		mv_la = 0;
		mv = 0;
		pm24 = 0;
		pm12 = 0;
		linea_articulos = 0;
		linea_prestamos = 0;
	}
	
	public Cliente(String ultupdt, String almacen, String monto, String tipo, float saldo_actual, float liquede_con, float mv_la, 
			float mv, float pm24, float pm12, float linea_articulos, float linea_prestamos)
	{
		this.ultupdt = ultupdt;
		this.almacen = almacen;
		this.monto = monto;
		this.tipo = tipo;
		this.saldo_actual = saldo_actual;
		this.liquede_con = liquede_con;
		this.mv_la = mv_la;
		this.mv = mv;
		this.pm24 = pm24;
		this.pm12 = pm12;
		this.linea_articulos = linea_articulos;
		this.linea_prestamos = linea_prestamos;
	}
	
	@Override
	public Object getProperty(int arg0) {

		switch(arg0)
        {
        case 0:
            return ultupdt;
        case 1:
            return almacen;
        case 2:
            return monto;
        case 3:
            return tipo;
        case 4:
            return saldo_actual;
        case 5:
            return liquede_con;
        case 6:
            return mv_la;
        case 7:
            return mv;
        case 8:
            return pm24;
        case 9:
            return pm12;
        case 10:
            return linea_articulos;
        case 11:
            return linea_prestamos;
        }
		
		return null;
	}
	
	@Override
	public int getPropertyCount() {
		return 11;
	}
	
	@Override
	public void getPropertyInfo(int ind, Hashtable ht, PropertyInfo info) {
		switch(ind)
        {
	        case 0:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "ultupdt";
	            break;
	        case 1:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "almacen";
	            break;
	        case 2:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "monto";
	            break;
	        case 3:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "tipo";
	            break;
	        case 4:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "saldo_actual";
	            break;
	        case 5:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "liquede_con";
	            break;
	        case 6:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "mv_la";
	            break;
	        case 7:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "mv";
	            break;
	        case 8:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "pm24";
	            break;
	        case 9:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "pm12";
	            break;
	        case 10:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "linea_articulos";
	            break;
	        case 11:
	        	info.type = PropertyInfo.STRING_CLASS;
	            info.name = "linea_prestamos";
	            break;
	        default:break;
        }
	}
	
	@Override
	public void setProperty(int ind, Object val) {
		switch(ind)
        {
	        case 0:
	        	ultupdt = val.toString();
	            break;
	        case 1:
	        	almacen = val.toString();
	            break;
	        case 2:
	        	monto = val.toString();
	            break;
	        case 3:
	        	tipo = val.toString();
	            break;
	        case 4:
	        	saldo_actual = Float.parseFloat(val.toString());
	            break;
	        case 5:
	        	liquede_con = Float.parseFloat(val.toString());
	            break;
	        case 6:
	        	mv_la = Float.parseFloat(val.toString());
	            break;
	        case 7:
	        	mv = Float.parseFloat(val.toString());
	            break;
	        case 8:
	        	pm24 = Float.parseFloat(val.toString());
	            break;
	        case 9:
	        	pm12 = Float.parseFloat(val.toString());
	            break;
	        case 10:
	        	linea_articulos = Float.parseFloat(val.toString());
	            break;
	        case 11:
	        	linea_prestamos = Float.parseFloat(val.toString());
	            break;
	        default:
	            break;
        }
	}
}
